#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
	struct Candidate 
	{
       char name[10];
       unsigned int count;
	}; 
	struct Candidate a[4]={
		{"ZS",0},
		{"LS",0},
		{"WW",0},
		{"QQ",0}
	};
	int n,i,j,flag;
	char na[10];
	scanf("%d",&n);
	if(n<=3 || n>100)
	{
		printf("Input Error\n");
	}
	else
	{
		for(i=1;i<=n;i++)
		{
			flag=0;
			scanf("%s",na);
			for(j=0;j<=2;j++)
			{
				if(strcmp(na,a[j].name)==0)
				{
					a[j].count++;
					flag=1;
				}
			}
			if(flag==0)
			{
				a[3].count++;
			}
		}
			printf("ZS:%d\n",a[0].count);
			printf("LS:%d\n",a[1].count);
			printf("WW:%d\n",a[2].count);
			printf("QQ:%d\n",a[3].count);

	}
	return 0;
}
